import { drawCanvas } from './userCanvas'
// 定义一个多圈动画
export function canvasAnimate({ source, layer, center,map }) {
  // 创建多圈动画
  const canvas = drawCanvas(map)
  // 设置点样式
  const style = new ol.style.Style({
    image: new ol.style.Icon({
      img: canvas,
      imgSize: [canvas.width, canvas.height],
    }),
  })
  layer.setStyle(style)
  // 根据中心坐标创建点
  const point = new ol.Feature({
    geometry: new ol.geom.Point(center),
  })
  source.addFeature(point)
}
